package vip.afeng.rpgserver.skill;

import org.springframework.stereotype.Component;
import vip.afeng.rpgserver.data.BasePropertyValue;
import vip.afeng.rpgserver.data.UpdateOne;

@Component
public class AbilityValue {

    private BasePropertyValue basePropertyValue;

    private Integer id;

    private Integer hp;

    private Integer mana;

    private Integer shenfa;

    private Integer tipo;

    private Integer jingli;

    private Integer shanbi;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getHp() {
        return hp;
    }

    public void setHp(Integer hp) {
        this.hp = hp;
    }

    public Integer getMana() {
        return mana;
    }

    public void setMana(Integer mana) {
        this.mana = mana;
    }

    public Integer getShenfa() {
        return shenfa;
    }

    public void setShenfa(Integer shenfa) {
        this.shenfa = shenfa;
    }

    public Integer getTipo() {
        return tipo;
    }

    public void setTipo(Integer tipo) {
        this.tipo = tipo;
    }

    public Integer getJingli() {
        return jingli;
    }

    public void setJingli(Integer jingli) {
        this.jingli = jingli;
    }

    public Integer getShanbi() {
        return shanbi;
    }

    public void setShanbi(Integer shanbi) {
        this.shanbi = shanbi;
    }

    public BasePropertyValue getBasePropertyValue() {
        return basePropertyValue;
    }

    public void setBasePropertyValue(BasePropertyValue basePropertyValue) {
        this.basePropertyValue = basePropertyValue;
    }

    public void reSet(int level, UpdateOne updateOne) {
        setHp(basePropertyValue.getHp()+level*Integer.valueOf(updateOne.getUpHp()));
        setJingli(basePropertyValue.getJingli() + level * Integer.valueOf(updateOne.getUpJingli()));
        setMana(basePropertyValue.getMana() + level * Integer.valueOf(updateOne.getUpMana()));
        setShanbi(basePropertyValue.getShanbi() + level * Integer.valueOf(updateOne.getUpShabi()));
        setShenfa(basePropertyValue.getShenfa() + level * Integer.valueOf(updateOne.getUpShenfa()));
        setTipo(basePropertyValue.getTipo()+level*Integer.valueOf(updateOne.getUpTipo()));
    }
}